package com.dhcc.model;

import javax.persistence.*;

/**
 * Created by guorui on 2017/3/17.
 */
@Entity
@Table(name = "tb_dtz", schema = "test", catalog = "")
public class Dtz {
    private int id;
    private int stuId;
    private String grade;
    private String useTime;
    private int planId;
    private int testId;
    private String remark;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "stu_id", nullable = false)
    public int getStuId() {
        return stuId;
    }

    public void setStuId(int stuId) {
        this.stuId = stuId;
    }

    @Basic
    @Column(name = "grade", nullable = false, length = 8)
    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    @Basic
    @Column(name = "use_time", nullable = false, length = 8)
    public String getUseTime() {
        return useTime;
    }

    public void setUseTime(String useTime) {
        this.useTime = useTime;
    }

    @Basic
    @Column(name = "plan_id", nullable = false)
    public int getPlanId() {
        return planId;
    }

    public void setPlanId(int planId) {
        this.planId = planId;
    }

    @Basic
    @Column(name = "test_id", nullable = false)
    public int getTestId() {
        return testId;
    }

    public void setTestId(int testId) {
        this.testId = testId;
    }

    @Basic
    @Column(name = "remark", nullable = true, length = 255)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Dtz dtz = (Dtz) o;

        if (id != dtz.id) return false;
        if (stuId != dtz.stuId) return false;
        if (planId != dtz.planId) return false;
        if (testId != dtz.testId) return false;
        if (grade != null ? !grade.equals(dtz.grade) : dtz.grade != null) return false;
        if (useTime != null ? !useTime.equals(dtz.useTime) : dtz.useTime != null) return false;
        if (remark != null ? !remark.equals(dtz.remark) : dtz.remark != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + stuId;
        result = 31 * result + (grade != null ? grade.hashCode() : 0);
        result = 31 * result + (useTime != null ? useTime.hashCode() : 0);
        result = 31 * result + planId;
        result = 31 * result + testId;
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        return result;
    }
}
